home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 6432 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.8 KB

  1. Path: news.infi.net!usenet
  2. From: nngis@norfolk.infi.net (Greg DiGiorgio)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: String manipulation routines for C
  5. Date: 24 Feb 1996 20:44:21 GMT
  6. Organization: Customer of InfiNet
  7. Message-ID: <4gntb5$i41@nw002.infi.net>
  8. References: <4gio78$ipr@bart.rogerswave.ca>
  9. NNTP-Posting-Host: h-talisman.norfolk.infi.net
  10. Mime-Version: 1.0
  11. X-Newsreader: WinVN 0.99.3
  12.  
  13. In article <4gio78$ipr@bart.rogerswave.ca>, mfrisch@saturn.tlug.org 
  14. says...
  15. >
  16. >        I am a (Turbo)Pascal programmer from way back, but now I have 
  17. moved 
  18. >to Unix and C.  I am looking for a decent library of string manipulation 
  19. >functions like I am used to in TurboPascal (ie. Copy, Delete, etc.).  
  20. Can 
  21. >anybody direct me to the these?  
  22.  
  23. Mike,
  24.  
  25. There are over 2 dozen standard, built-in functions for manipulating 
  26. strings in 'C' - way more than Pascal ever offered. The functions are 
  27. prototyped in an include file <string.h> and are explained in any 'C' 
  28. book. Following is a partial list. Please note that you must understand 
  29. 'C' strings and pointers to use the string functions.
  30.  
  31. strcpy - copy one string to another
  32. strcat - concatenate one string on the end of another
  33. strtok - parse a string based on one or more characters used as 
  34. delimiters
  35. strcmp - compare 2 strings to see if there are the same (case sensitive)
  36. stricmp - same as above, but case insensitive
  37. strstr - search for a substring in a string
  38. strchr - search for a character in a string
  39. strrev - reverse a string
  40. sprintf - format non-stirngs variables into a string
  41. atoi - xlat a string to an integer (like BASIC's VAL fn)
  42. itoa - xlat an integer to a string (like BASIC's STR fn)
  43.  
  44. There are alot more, but for the newbie, they are not easy to use. Please 
  45. remember to learn about strings and pointers before you plunge too 
  46. deeply.
  47.  
  48. Hope this helps,
  49. Greg DiGiorgio
  50.  
  51.  
  52.  
  53.  
  54.  
  55.